//投资
var vm = new Vue({
	el: '#app',
	data: function() {
		return {
			userName:'',
			userPwd:''
		}
	},
	mounted: function() {
		var that = this;
		mui.init();
		mui.ready(function() {
			

		});
	},
	methods: {
		login:function(){
			var that=this;
			var userName=that.userName;
			var userPwd=that.userPwd;
			if(!userName){
				mui.toast('请输入用户名');
				return false;
			}
			if(!userPwd){
				mui.toast('请输入密码');
				return false;
			}
            var openid = $("#openid").val();
            $.ajax({
                url:"userLogin",
                data:{"userName":userName,"pwd":userPwd,"openid":openid},
                type:"post",
                dataType:"json",
                success : function(json){
                    if(json.success){
                        location.href='home';
                    }else{
                        mui.toast('用户名或者密码不对！');
                    }
                }
            });
		}
	}
})